Skip to content

Remove chain walk for OCSP responder#10532

Merged
douzzer merged 2 commits into
wolfSSL:masterfrom
rlm2002:zd21800
Jun 5, 2026
Merged

Remove chain walk for OCSP responder#10532
douzzer merged 2 commits into
wolfSSL:masterfrom
rlm2002:zd21800

Conversation

@rlm2002
Copy link
Copy Markdown
Contributor

@rlm2002 rlm2002 commented May 26, 2026

Description

Removes CheckOcspResponderChain() which was not compliant with RFC 6960 4.2.2.2. for hardening. The chain walk authorized any OCSP responder cert issued by an ancestor of the target's issuer. RFC
requires issuance directly by the CA identified in the request. Also removes references to related macro WOLFSSL_NO_OCSP_ISSUER_CHAIN_CHECK.

Drops the now-unused vp parameter from CheckOcspResponder() and cascades through the static OcspRespCheck() helper. Updates the prototype in wolfssl/ocsp.h, the definition in src/ocsp.c, and call sites across wolfcrypt/src/asn.c,
wolfcrypt/src/asn_orig.c, and src/ocsp.c.

Updates OCSP test blobs to reflect updated functionality.

  • re-sign resp_server1_cert with intermediate1-ca (Was previously signed by ocsp-responder-cert - issued by root, not intermediate1)
  • new resp_server1_cert_ancestor_responder - preserves the old ancestor-issued shape for negative testing
  • response[] re-captured with intermediate1-ca as signer. Recipe comment switched from Wireshark to openssl -respout + xxd -I
  • fix self-XOR (request->serial[0] ^= request->serial[0]) in test_wolfSSL_CertManagerCheckOCSPResponse so the serial byte actually flips (^= 0xFF)

Updates live OCSP tests to exercise both RFC 6960 4.2.2.2 authorization paths the implementation supports (CA-direct, delegated responder):

  • adds certs/ocsp/ocsp-responder-int1-{cert,key}.{pem,der} (delegated responder issued directly by intermediate1-ca, with id-kp-OCSPSigning EKU). Provides live coverage of the delegated path across a responder→intermediate→root chain.
  • new update_cert entry in certs/ocsp/renewcerts.sh and matching EXTRA_DIST lines in certs/ocsp/include.am for int1
  • regenerated test-leaf-response.der using ocsp-responder-int1
  • scripts/ocsp-stapling.test: intermediate1 responder switched from ocsp-responder-cert.pem to ocsp-responder-int1 (delegated path)
  • scripts/ocsp-stapling2.test, scripts/ocsp-stapling_tls13multi.test: intermediate2 / intermediate3 responders sign their OCSP responses directly with their CA keys (CA-direct path); the root-CA blocks remain unchanged (ocsp-responder-cert is still
    RFC-compliant for root-issued certs)
  • .github/workflows/ocsp.yml: server1 OCSP responder switched to ocsp-responder-int1 to match the cert chain

Adds test_ocsp_ancestor_responder_rejected unit test.

ChangeLog.md has been updated to make note of removed function and related content.

Addresses zd#21800

Testing

./configure --enable-ocsp --enable-ocsp-responder && make check
./configure --enable-all && make check

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@rlm2002 rlm2002 self-assigned this May 26, 2026
@rlm2002 rlm2002 force-pushed the zd21800 branch 4 times, most recently from 82f2600 to 9378a1c Compare May 27, 2026 21:44
@rlm2002 rlm2002 marked this pull request as ready for review May 27, 2026 22:04
@github-actions
Copy link
Copy Markdown

retest this please

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

MemBrowse Memory Report

No memory changes detected for:

rlm2002 added 2 commits June 2, 2026 16:20
…t compliant with RFC 6960, 4.2.2.2.

remove unused vp parameter

Update ChangeLog.md to include OCSP responder change
  authorized any responder issued by an ancestor of the target's issuer;
  RFC 6960 4.2.2.2 requires direct issuance by the CA identified in the
  request.

    - Remove CheckOcspResponderChain() and WOLFSSL_NO_OCSP_ISSUER_CHAIN_CHECK.
    - Drop now-unused vp parameter from CheckOcspResponder() and the
      OcspRespCheck() helper; cascade through template and non-template
      paths.

  OCSP test blobs:

    - Re-sign resp_server1_cert with intermediate1-ca (CA-direct path).
    - Add resp_server1_cert_ancestor_responder for the negative test.
    - Embed server1_cert_pem[] in test_ocsp_test_blobs.h so the new test
      runs under NO_FILESYSTEM; matching entry added to
      create_ocsp_test_blobs.py.
    - Regenerate response[] in test_certman.c with intermediate1-ca as
      signer; recipe switched from Wireshark export to openssl -respout
      + xxd -i for reproducibility.
    - Fix self-XOR in test_wolfSSL_CertManagerCheckOCSPResponse so the
      serial byte actually flips (^= 0xFF).

  Live OCSP coverage:

    - Add ocsp-responder-int1 (delegated responder issued directly by
      intermediate1-ca, with id-kp-OCSPSigning EKU) for the
      responder->intermediate->root chain.
    - scripts/ocsp-stapling.test: intermediate1 responder switched to
      ocsp-responder-int1 (delegated path).
    - scripts/ocsp-stapling2.test, scripts/ocsp-stapling_tls13multi.test:
      intermediate2 and intermediate3 sign their OCSP responses with
      their own CA keys (CA-direct path); root block unchanged
      (ocsp-responder-cert is still RFC-compliant for root-issued certs).
    - .github/workflows/ocsp.yml: server1 OCSP responder switched to
      ocsp-responder-int1 to match the cert chain.
    - New test_ocsp_ancestor_responder_rejected confirms the
      ancestor-issued response is rejected with OCSP_LOOKUP_FAIL.
Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #10532

Scan targets checked: wolfcrypt-bugs, wolfcrypt-rs-bugs, wolfcrypt-src, wolfssl-bugs, wolfssl-src

No new issues found in the changed files. ✅

@douzzer douzzer added the Staged Staged for merge pending final test results and review label Jun 5, 2026
@douzzer douzzer merged commit 8fca95c into wolfSSL:master Jun 5, 2026
561 of 562 checks passed
@douzzer douzzer removed the Staged Staged for merge pending final test results and review label Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants